--- CMakeLists.txt	2021-12-22 23:01:57.000000000 +0000
+++ CMakeLists.txt.new	2021-12-27 17:32:52.708000000 +0000
@@ -175,33 +175,7 @@
 include_directories(SYSTEM ${Boost_INCLUDE_DIR})
 link_directories(${Boost_LIBRARY_DIRS})
 
-find_package(glm QUIET)
-if(glm_FOUND)
-  if(TARGET glm::glm)
-    message(STATUS "Found glm")
-  else()
-    # fallback for old glm version in EmuELEC and Nix
-    get_target_property(GLM_INCLUDE_DIR glm INTERFACE_INCLUDE_DIRECTORIES)
-    message(STATUS "Found glm: ${GLM_INCLUDE_DIR}")
-    add_library(glm::glm INTERFACE IMPORTED)
-    set_target_properties(glm::glm PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES ${GLM_INCLUDE_DIR})
-  endif()
-else()
-  # fallback for old glm version in UBPorts
-  find_path(GLM_INCLUDE_DIR
-    NAMES glm/glm.hpp
-    PATHS ${GLM_ROOT_DIR}/include)
-  if(NOT GLM_INCLUDE_DIR)
-    message(FATAL_ERROR "glm library missing")
-  endif()
-
-  message(STATUS "Found glm: ${GLM_INCLUDE_DIR}")
-  add_library(glm::glm INTERFACE IMPORTED)
-  set_target_properties(glm::glm PROPERTIES
-    INTERFACE_INCLUDE_DIRECTORIES ${GLM_INCLUDE_DIR})
-endif()
-
+find_package(GLM)
 find_package(PNG REQUIRED)
 
 if(WIN32)
@@ -918,7 +892,7 @@
 add_library(supertux2_c OBJECT ${SUPERTUX_SOURCES_C})
 add_library(supertux2_lib STATIC ${CMAKE_BINARY_DIR}/version.h ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} $<TARGET_OBJECTS:supertux2_c>)
 
-target_link_libraries(supertux2_lib PUBLIC glm::glm)
+target_link_libraries(supertux2_lib ${GLM_LIBRARIES})
 target_compile_definitions(supertux2_lib PUBLIC -DGLM_ENABLE_EXPERIMENTAL)
 
 if(WIN32)
